import React from "react";
import { inject, observer } from "mobx-react";
@inject("singer") 
@observer
class SingerList extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      singerList: '',
      singerSort: this.props.singer.singerSort
    };
  }
  //  渲染
  render() {
    return (
      <div className="singer-list">
        {this.props.singer.singerList &&
          this.props.singer.singerList.map((item, index) => {
            return (
              <div
                className="list-item"
                key={index}
                onClick={() => {
                  console.log(index);
                }}
              >
                  <div className='detal'>查看详情</div>
                <img src={item.img1v1Url} alt=""></img>
                <p className="list-item-name">{item.name}</p>
              </div>
            );
          })}
      </div>
    );
  }
}

export default SingerList;
